﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;
using System.Text;
using Maticsoft.DBUtility;
using Utils;
using System.Collections.Specialized;
using Maticsoft.Model;


public partial class WebPage_ajaxPage_Ajax_Manager_Type : SystemBBasePage
{
    // Fields
    protected NameValueCollection user = new NameValueCollection();

    // Methods
    protected override void OnLoad(EventArgs e)
    {
        base.OnLoad(e);
        Maticsoft.BLL. UserInfo info = new Maticsoft.BLL.UserInfo();
        UserInfo model = new UserInfo();
        int @int = Helper.GetInt(base.Request["id"], 0);
        if (@int > 0)
        {
            model = info.GetModel(@int);
        }
        if (Helper.GetString(base.Request["buttontype"], string.Empty) == "确定授权")
        {
            string str = Helper.GetString(base.Request["auth"], string.Empty);
            if (str != string.Empty)
            {
                str = "{" + str.Replace(",", "}{") + "}";
            }
            model.Auth = str;
            info.Update(model);
            base.SetSuccess("更改" + model.Username + "权限成功");
            base.Response.Redirect(base.Request.UrlReferrer.AbsoluteUri);
        }
        else
        {
            this.user = Helper.GetObjectProtery(model);
        }
    }

}